#include <functional.h>
#include <stdlib.h>
#include <string.h>

int str_cpy( char **dest, const char *src )
{
    int len;
    if( src == NULL )
    {
        *dest = NULL;
        return 0;
    }
    len = strlen(src);
    *dest = (char*)malloc( len+1 );
    strcpy( *dest, src );
    return len;
}

void str_free( char *str )
{
    if( str )
        free( str );
}
